import React, { useState } from 'react';
import { Button, Checkbox, Form, Input, Select, Upload } from 'antd';
import { history } from 'umi';
import { PlusOutlined } from '@ant-design/icons';


function photo() {
    const [state,setState]:any=useState(history.location.state)
  const onFinish = (values: any) => {
    console.log('Success:', values);
    
  };

  const onFinishFailed = (errorInfo: any) => {
    console.log('Failed:', errorInfo);
  };
  return (
    
    <div>
      <Form
        name="basic"
        labelCol={{ span: 2 }}
        wrapperCol={{ span: 10 }}
        initialValues={{ remember: true }}
        onFinish={onFinish}
        onFinishFailed={onFinishFailed}
        autoComplete="off"
      >
        <Form.Item label="所属楼盘" name="username">
          <Input defaultValue={state.state} bordered={false} disabled/>
        </Form.Item>

        <Form.Item label="所属分类" name="password">
          <Select
            defaultValue="default"
            style={{ width: 120 }}
            options={[
              {
                value: 'default',
                label: '--请选择--',
              },
              {
                value: 'jack',
                label: '实景图',
              },
              {
                value: 'lucy',
                label: '效果图',
              },
              {
                value: 'disabled',
                label: '配套图',
              },
              {
                value: 'Yiminghe',
                label: '样板间',
              },
            ]}
          />
        </Form.Item>

        <Form.Item label="选择图片" name="password">
          <Upload action="/upload.do" listType="picture-card">
            <div>
              <PlusOutlined />
              <div style={{ marginTop: 8 }}>上传图片</div>
            </div>
          </Upload>
        </Form.Item>

        <Form.Item wrapperCol={{ offset: 2, span: 16 }}>
          <Button type="primary" htmlType="submit">
            提交
          </Button>
        </Form.Item>
      </Form>
    </div>
  );
}

export default photo;
